package easymall.dao;

import easymall.po.OrderItem;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
public interface OrderItemDao {
	@Insert("insert into orderitem(order_id,product_id,buynum) values(#{order_id},#{product_id},#{buynum})")
	public void addOrderItem(OrderItem orderItem);

	@Select("select * from orderitem where order_id = #{order_id}")
	public List<OrderItem> getOrderItemsByOrderId(String order_id);

	@Delete("delete from orderitem where order_id = #{id}")
	public void delOrderItem(String id);
}
